//
// Created by kevin on 25-9-3.
//

#ifndef SYS_INC_H
#define SYS_INC_H
// 结构定义
typedef enum {
    TCP_MODE,
    UDP_MODE
} socket_mode_t;

typedef enum {
    STATE_DISCONNECTED,
    STATE_CONNECTING,
    STATE_CONNECTED,
    STATE_RECONNECTING
} connection_state_t;

typedef struct {
    char* server_ip;
    int server_port;
    socket_mode_t mode;
    int heartbeat_interval; // 心跳间隔(秒)
    int reconnect_interval; // 重连间隔(秒)
} connection_config_t;

typedef struct {
    void (*on_connected)(void);
    void (*on_disconnected)(void);
    void (*on_message_received)(const char* data, size_t length);
    void (*on_error)(const char* error_msg);
} event_callbacks_t;

typedef struct socket_client_s socket_client_t;
#endif //SYS_INC_H
